package dao;

import pojo.Order;
import pojo.OrderItem;
import pojo.User;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * @author LiangHaiBo
 * @version 1.0
 * @date 2021.9.10 下午 14:46
 */
public interface OrderDao {
    /**
     * 添加订单数据
     * @param order
     */
    void insertOrder(Order order) throws SQLException;

    /**
     * 添加订单项数据
     * @param orderItem
     */
    void insertOrderItem(OrderItem orderItem) throws SQLException;

    /**
     * 分页查询我的订单
     * @param currentPage
     * @param pageSize
     * @param user
     * @return
     */
    List<Order> OrderbyPage(int currentPage, int pageSize, User user) throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 获取订单总条数
     * @return
     */
    int selecttotalCount() throws SQLException;

    /**
     * 查询订单的详情
     * @param oid
     * @return
     */
    Order selectOrderById(String oid) throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 更新订单
     * @param order
     */
    void update(Order order) throws SQLException;
}
